<?php
/**
 * @function  TestController.php
 * @Author: hanlc <hanlc@okooo.net>
 * @Date: 2017/5/26 11:56
 */

namespace App\Http\Controllers;


use App\Ok\Handler\StreamHandler;
use App\Ok\Log\Logger;
use App\Ok\Log\LoggerOld;
use Illuminate\Support\Facades\Log;
use Monolog\Handler\Mongo;

class TestController
{
	public function test(){

		$msg = json_encode([
			"data"=>"xxxx",
			"aa"=>"bbb",
			"time"=>date("Y-m-d H:i:s u")]
		);
		app("oklog")->setLogger("logger")->info($msg);
		/*
		$log = new Logger();
		$path = app()->storagePath().'/logs/laravel.log';
		$level = Logger::INFO;
		$log->pushHandler(new \Monolog\Handler\StreamHandler($path,$level));
		$log->info($msg);
		*/
		return $msg;
	}

}